home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / Dev / Amiga-E / E_v3.2a_extras / PdSrc / agacc.e next >
Text File  |  1992-09-02  |  2KB  |  72 lines

  1. OPT OSVERSION=39
  2.  
  3. MODULE 'intuition/intuition'
  4.  
  5. DEF s,w:PTR TO window,rast,x,m,mx,my,r,g,b
  6.  
  7. PROC main()
  8.   IF s:=OpenS(320,256,8,$800,'AGA Colour Cube')
  9.     rast:=stdrast
  10.     IF w:=OpenW(0,11,320,245,0,WFLG_BORDERLESS,0,s,15,0)
  11.       SetTopaz(8)
  12.       fullcolour(0,0,0,0)
  13.       fullcolour(1,$40,$80,$c0)
  14.       fullcolour(11,0,0,0)
  15.       fullcolour(12,0,0,0)
  16.       fullcolour(13,0,0,0)
  17.       fullcolour(6,0,0,0)
  18.       r:=0
  19.       g:=0
  20.       b:=0
  21.       Line(0,16,0,79,11)
  22.       Line(70,16,70,79,12)
  23.       Line(140,16,140,79,13)
  24.       FOR x:=0 TO 63
  25.         Plot(1,16+x,192+x)
  26.         Plot(71,16+x,64+x)
  27.         Plot(141,16+x,128+x)
  28.         Line(2+x,16,2+x,79,64+x)
  29.         Line(72+x,16,72+x,79,128+x)
  30.         Line(142+x,16,142+x,79,192+x)
  31.       ENDFOR
  32.       Colour(6,0)
  33.       RectFill(w.rport,0,82,205,120)
  34.       Colour(5,0)
  35.       fullcolour(5,255,255,255)
  36.       TextF(44,10,'R:\z\h[2] G:\z\h[2] B:\z\h[2]',r,g,b)
  37.       TextF(0,130,'Left mouse on square changes')
  38.       TextF(0,138,'Red, Green or Blue colour')
  39.       TextF(0,146,'component. Right mouse exits.')
  40.       WHILE Mouse()<>2
  41.         Delay(1)
  42.         mx:=MouseX(w)
  43.         my:=MouseY(w)
  44.         m:=Mouse()
  45.         IF (m=1) AND (my>=16) AND (my<=79)
  46.           IF (mx>=2) AND (mx<=65)
  47.             b:=mx-2*4
  48.             g:=my-16*4
  49.           ENDIF
  50.           IF (mx>=72) AND (mx<=135)
  51.             r:=mx-72*4
  52.             b:=my-16*4
  53.           ENDIF
  54.           IF (mx>=142) AND (mx<=205)
  55.             g:=mx-142*4
  56.             r:=my-16*4
  57.           ENDIF
  58.           fullcolour(11,r,0,0)
  59.           fullcolour(12,0,g,0)
  60.           fullcolour(13,0,0,b)
  61.           fullcolour(6,r,g,b)
  62.           TextF(44,10,'R:\z\h[2] G:\z\h[2] B:\z\h[2]',r,g,b)
  63.         ENDIF
  64.       ENDWHILE
  65.       CloseWindow(w)
  66.     ENDIF
  67.     CloseScreen(s)
  68.   ENDIF
  69. ENDPROC
  70.  
  71. PROC fullcolour(nr,r,g,b) IS SetColour(s,nr,r,g,b)
  72.